﻿function Add()
{
    var prefix = "ctl00_ContentPlaceHolder1_";
    var positionid = document.getElementById(prefix + "ddlAdPosition");
    var adname = document.getElementById(prefix + "txtAdName");
    //var imageurl = document.getElementById(prefix + "fuImage");
    var linkurl = document.getElementById(prefix + "txtLinkURL");

    if (positionid.value == "-1")
    {
        alert("请选择广告位！");
        positionid.focus();
        return false;
    }
    if (adname.value.length == 0)
    {
        alert("请输入广告名称！");
        adname.focus();
        return false;
    }
//    if (imageurl.value.length == 0)
//    {
//        alert("请上传广告图片！");
//        imageurl.focus();
//        return false;
//    }
    if (linkurl.value.length == 0)
    {
        alert("请填写链接地址！");
        linkurl.focus();
        return false;
    }
    return true;

}


function Edit()
{
    var prefix = "ctl00_ContentPlaceHolder1_";
    var adname = document.getElementById(prefix + "txtAdName");
    var linkurl = document.getElementById(prefix + "txtLinkURL");

    if (adname.value.length == 0)
    {
        alert("请输入广告名称！");
        adname.focus();
        return false;
    }
    if (linkurl.value.length == 0)
    {
        alert("请填写链接地址！");
        linkurl.focus();
        return false;
    }
    return true;

}